import $ from 'jquery';
import Parallax from 'scroll-parallax'

import "./common.less"

function navAnimate() {
    var $header = $('.header');
    var $nav = $header.children('.navbar');
    $('<div />').css({ height: 80 }).insertAfter($header);

    $(window).on('scroll', () => {
        if ($(window).scrollTop() > 200) {
            $nav.addClass('hide')
        } else {
            $nav.removeClass('hide')
        }
    })
}
navAnimate();
new Parallax('.parallax1', {
    offsetYBounds: 50,
    intensity: 60,
    center: 0.8,
    safeHeight: 0.15
}).init()

$('#dropdown-dropup').on('click', function () {
    $(this).find('.dropdown-menu').toggle()
})